# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
file(GLOB_RECURSE SOURCES
    "./*.c"
    #daplink
    "../DAP/*.c"
    "../DAP/Source/*.c"
    "../DAP/SW_DP/*.c"
    "../DAP/JTAG_DP/*.c"
    "../DAP/platform/dedic_io/*.c"
    "../DAP/platform/gp_spi/*.c"
    #设置
    "../Settings/*.c"
    #usb-jtag
    "../esp_usb_jtag/*.c"
    #usb-public
    "../usb_public/*.c"
    #usb2uart
    "../usb2uart/*.c"
    #wifi
    "../wifi/*.c"
    #wireless
    "../wireless/*.c"
    "../wireless/USBIP/*.c"

    #logic_analyzer
    "../logic_analyzer/logic_analyzer_hal/logic_analyzer_hal.c"
    "../logic_analyzer/logic_analyzer_cdc/logic_analyzer_cdc.c"
    "../logic_analyzer/logic_analyzer_hal/esp32s3/logic_analyzer_ll.c"
    "../logic_analyzer/logic_analyzer_hal/esp32s3/logic_analyzer_triggered_isr_start.c"
    "../logic_analyzer/logic_analyzer_hal/esp32s3/logic_analyzer_hi_interrupt_handler.s"
    "../logic_analyzer/logic_analyzer_sump/logic_analyzer_sump.c"
    #hal
    "../hal/*.c"
    #driver
    "../driver/lcd/*.c"
    "../driver/PCA9557PW/*.c"
    "../driver/QMI8658A/*.c"
    "../driver/audio/*.c"
    "../driver/sd_card/*.c" 
    "../driver/esp_sr/*.c" 

    #ui
    "../ui/*.c"
    "../ui/func_ui/*.c"
    "../ui/func_ui/src/*.c"
    "../ui/images/*.c"
    "../ui/images/resources/*.c"
    "../ui/images/resources/pvz_images/*.c"
    "../ui/fonts/*.c"
    "../ui/languages/*.c"
    "../ui/utils/*.c"
    #game
    "../game/*.c"
    "../game/pvz/*.c"
    "../game/pvz/pvz_images/*.c"   
    #test
    "../test/*.c"
    #players
    "../players/avi_player/*.c"
    "../players/audio_player/*.c"
    "../players/image_player/*.c"
    #usb_msc_wrieless_disk
    "../usb_msc_wireless_disk/*.c"
    #usb_extend_screen
    "../usb_extend_screen/src/*.c"
    #shell
    "../shell/*.c"
    "../shell/cmd_wifi/*.c"
    "../shell/cmd_system/*.c"
    "../shell/cmd_nvs/*.c"
    "../shell/cmd_MdLink/*.c"
    )

set(include_dirs 
    "."
    #daplink

    "../DAP"
    "../DAP/Include"
    "../DAP/Config"
    "../DAP/SW_DP"
    "../DAP/JTAG_DP"
    "../DAP/platform/dedic_io"
    "../DAP/platform/gp_spi"
    #设置
    "../Settings"
    #usb-jtag
    "../esp_usb_jtag"
    #usb-public
    "../usb_public"
    #usb2uart
    "../usb2uart"
    #wifi
    "../wifi"
    #wireless
    "../wireless"
    "../wireless/USBIP"
    #logic_analyzer
    "../logic_analyzer/logic_analyzer_hal/include"
    "../logic_analyzer/logic_analyzer_hal/private_include"
    "../logic_analyzer/logic_analyzer_hal/esp32s3/private_include"
    "../logic_analyzer/logic_analyzer_sump/include"
    "../logic_analyzer/logic_analyzer_sump/private_include"
    "../logic_analyzer/logic_analyzer_cdc"
    #global_config
    "../MDLink_Config"
    #hal
    "../hal"
    #driver
    "../driver/lcd"
    "../driver/PCA9557PW"
    "../driver/QMI8658A"
    "../driver/audio"
    "../driver/sd_card"
    "../driver/esp_sr"
    #ui
    "../ui"
    "../ui/func_ui"
    "../ui/func_ui/include"
    "../ui/fonts"
    "../ui/images"
    "../ui/languages"
    "../ui/utils/"
    #game
    "../game/"
    "../game/pvz"
    #test
    "../test"
    #players
    "../players/avi_player"
    "../players/audio_player"
    "../players/image_player"
    #usb_msc_wrieless_disk
    "../usb_msc_wireless_disk"
    #usb_extend_screen
    "../usb_extend_screen/include"
    #shell
    "../shell"
    "../shell/cmd_wifi"
    "../shell/cmd_system"
    "../shell/cmd_nvs"
    "../shell/cmd_MdLink"
    )
idf_component_register(SRCS ${SOURCES}
                       INCLUDE_DIRS ${include_dirs}
                       REQUIRES nvs_flash driver esp_timer usb esp_netif esp_wifi mbedtls app_update esp_psram esp_mm esp_http_server esp_http_client
                       ir_ctl_air fatfs sdmmc console       
                       WHOLE_ARCHIVE
                       EMBED_FILES "../driver/audio/start_audio/sword.pcm" "../game/pvz/pvz_audio/pvz_bg.pcm"
                       EMBED_FILES "../spiffs/favicon.ico"
                        "../spiffs/upload.html"
                        "../spiffs/file_list_1.html"
                        "../spiffs/file_list_2.html"
                        "../spiffs/settings.html"
                        "../spiffs/styles.css"

                       #LDFRAGMENTS font.lf
                       )
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable -Wno-format -Wno-format-truncation -Wno-incompatible-pointer-types)
